<!--购物车-->

<template>
    <div class="cart">
        <h2>我的购物车</h2>
        <p><i>请添加一些商品到购物车</i></p>
        <ul>
            <li v-for="cart in cartStore.cartProducts" :key="cart.id">{{cart.title}} - {{cart.price}} * {{cart.num}}</li>
        </ul>
        <p>商品总价：{{cartStore.totalPrice}}</p>
    </div>
    <button @click="cartStore.getSettleStatus">结算</button>
    <p v-show="cartStore.settleStatus">{{`结算${cartStore.settleStatus}`}}</p>
</template>

<script setup lang="ts">
    import {useCartStore} from '../store/cart'
    const cartStore = useCartStore()
    console.log(cartStore.settleStatus)
</script>

<style scoped lang="less">

</style>
